package utils;

import java.util.ArrayList;

/**
 * Created by IntelliJ IDEA.
 * User: Cyril
 * Date: 13.08.11
 * Time: 1:22
 * To change this template use File | Settings | File Templates.
 */
public class Pager extends ArrayList<Pager.Page> {
    protected int currentPage;
    protected int numPages;
    protected DefaultPagerLayout layout = new DefaultPagerLayout();

    public Pager(int currentPage, int numPages) {
        this.currentPage = currentPage;
        this.numPages = numPages;
        layout.doLoyout(this);
    }

    public int getCurrentPage() {
        return currentPage;
    }

    public int getNumPages() {
        return numPages;
    }

    public class Page {
        protected int page;
        protected String label;

        public Page(int page, String label) {
            this.page = page;
            this.label = label;
        }

        public int getPage() {
            return page;
        }

        public String getLabel() {
            return label;
        }
    }

    public Page createPage(int page, String label) {
        return new Page(page, label);
    }
}
